-- card: 6525 from stack: in -- bmap block id: 8587 -- flags: 0000 -- background id: 3493 -- name: format -- part 1 (button) -- low flags: 00 -- high flags: A003 -- rect: left=88 top=199 right=219 bottom=204 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: format normal ----- HyperTalk script ----- on mouseUp put editString("format", fld A, cd fld numDecs, TRUE, cd fld numChars, TRUE) into fld b end mouseUp -- part 2 (button) -- low flags: 00 -- high flags: A003 -- rect: left=88 top=220 right=240 bottom=204 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: format Sci. Not. ----- HyperTalk script ----- on mouseUp put editString("format", fld A, cd fld numDecs, FALSE, cd fld numChars, TRUE) into fld b end mouseUp -- part 3 (field) -- low flags: 00 -- high flags: 0002 -- rect: left=332 top=218 right=235 bottom=363 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 97 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: numChars -- part 4 (field) -- low flags: 00 -- high flags: 0002 -- rect: left=436 top=218 right=235 bottom=467 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 97 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: numDecs -- part contents for background part 2 ----- text ----- This function is for formatting numbers to a specified number of decimal places. It will format the number into standard decimal or scientific notation. It will also take as input standard decimal or scientific notation. -- part contents for background part 1 ----- text ----- format -- part contents for background part 3 ----- text ----- editString("Format", source, numDecimals, doDecimal, fieldWidth, padRight) • source is the input number (can be scientific notation) • numDecimals is the number of desired decimals (less one for Sci. Notation) • doDecimal is TRUE for standard decimal format, FALSE for Sci. Notation • fieldWidth is the desired resultant field width padded with spaces • padRight is TRUE to place the number in the right, FALSE for the left Note: if fieldWidth is too small to display the number then it is ignored. -- part contents for card part 3 ----- text ----- 18 -- part contents for card part 4 ----- text ----- 5 -- part contents for background part 4 ----- text ----- 2.3455E+2 -- part contents for background part 5 ----- text ----- 234.55000